#include "exc_screen.h"
#include "lvgl.h"
#include <stdio.h>

lv_obj_t *page_1,*page_2,*page_switch;




//起励
//例程入口
void lvAdd_excScreen()
{
    lvAdd_pageSwitch();
    lvAdd_page_01firstPage();
    lvAdd_page_02Promotion();
    lvAdd_page_03OperationLock();
    lvAdd_page_05Analogic();
    lvAdd_page_06IO();

    lvChange_switchPage(page_switch);
//    lvChange_switchPage(page_05Analogic);
}


void cb_btntoSwitch(lv_obj_t * btn, lv_event_t event)
{
    if(event == LV_EVENT_CLICKED)
    {
        lvChange_switchPage(page_switch);
    }
}

void lv_obj_set_gaval(lv_obj_t * obj, lv_coord_t gaval)
{
    lv_gauge_set_value(obj, 0, gaval);
}

void lvChange_gaugeAnim(lv_obj_t *gauge, lv_anim_value_t value)
{
    lv_anim_t a;
    lv_anim_init(&a);
    /* MANDATORY SETTINGS
    *------------------*/
    /*Set the "animator" function*/
    lv_anim_set_exec_cb(&a, (lv_anim_exec_xcb_t) lv_obj_set_gaval);
    /*Set the "animator" function*/
    lv_anim_set_var(&a, gauge);
    /*Length of the animation [ms]*/
    lv_anim_set_time(&a, 300);
    /*Set start and end values. E.g. 0, 150*/
    lv_anim_set_values(&a, lv_gauge_get_value(gauge, 0), value);
    lv_anim_start(&a);
}
